﻿

using System;
using Frame.Lib.Core.Tree;
namespace Frame.Lib.Core.Module
{
    public partial class ModuleInfo:TreeInfo
    {
        public override string GetTableName()
        {
            return "s_Module";
        }
        public override string GetInsertSql()
        {
            return "insert into s_Module ( [ID], [Name], [Code], [UpperID], [Path], [Depth], [Orders], [NavUrl], [IconUrl], [Remark], [State]) values ( @ID, @Name, @Code, @UpperID, @Path, @Depth, @Orders, @NavUrl, @IconUrl, @Remark, @State)";
        }
        public override string GetUpdateSql()
        {
            return "update s_Module set [Name] = @Name, [Code] = @Code, [UpperID] = @UpperID, [Path] = @Path, [Depth] = @Depth, [Orders] = @Orders, [NavUrl] = @NavUrl, [IconUrl] = @IconUrl, [Remark] = @Remark, [State] = @State where ID = @ID";
        }


        public ModuleInfo() { }
       
        public string Code
        {
            get;
            set;
        }      
        public string NavUrl
        {
            get;
            set;
        }
        public string IconUrl
        {
            get;
            set;
        }
        public string Remark
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        public Int32 State
        {
            get;
            set;
        }
        public override void SetValue(string key, object value)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    this.ID = (Int32)value;
                    break;
                case "name":
                    this.Name = (String)value;
                    break;
                case "code":
                    this.Code = (String)value;
                    break;
                case "upperid":
                    this.UpperID = (Int32)value;
                    break;
                case "path":
                    this.Path = (String)value;
                    break;
                case "depth":
                    this.Depth = (Int32)value;
                    break;
                case "orders":
                    this.Orders = (Int32)value;
                    break;
                case "navurl":
                    this.NavUrl = (String)value;
                    break;
                case "iconurl":
                    this.IconUrl = (String)value;
                    break;
                case "remark":
                    this.Remark = (String)value;
                    break;
                case "state":
                    this.State = (Int32)value;
                    break;
            }
        }
        public override object GetValue(string key)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    return this.ID;
                case "name":
                    return this.Name;
                case "code":
                    return this.Code;
                case "upperid":
                    return this.UpperID;
                case "path":
                    return this.Path;
                case "depth":
                    return this.Depth;
                case "orders":
                    return this.Orders;
                case "navurl":
                    return this.NavUrl;
                case "iconurl":
                    return this.IconUrl;
                case "remark":
                    return this.Remark;
                case "state":
                    return this.State;
                default:
                    return null;
            }
        }


    }
}